home *** CD-ROM | disk | FTP | other *** search
/ Internet Tools (InfoMagic) / Internet Tools.iso / fax / leffler / contrib / bobs-faxmailer / README < prev    next >
Text File  |  1995-01-23  |  6KB  |  128 lines

  1. Last updated: January 23, 1995 bobj@uic.edu
  2.  
  3. This is my entry into the e-mail to fax gateway arena. The details
  4. below work for me; your milage may vary.
  5.  
  6. First, the standard disclaimer. The University of Illinois, and the University
  7. of Illinois Board of Trustees are not liable for any damage which may result 
  8. from use or abuse of this software. Use it at your own risk.
  9.  
  10. Second, some thanks. These files are based on Dirk Husemann's mail-to-fax
  11. gateway. The faxmailer-agent perl script is basically his. I've cleaned it
  12. up a bit, removed some extra functionality (which we, at UIC, will not use),
  13. and added better header parsing for incoming mail. Thanks Dirk! You'll need
  14. Dirk's package, also available from sgi.com. Follow the instructions for
  15. installation in his instructions. The below is IN ADDITION TO Dirk's package.
  16.  
  17.     That said...
  18.  
  19. "How to set up an e-mial to fax gateway" or
  20. "Finally Figure Out That E-mail Gateway Stuff"
  21.  
  22. At UIC, we use the e-mail format arbitrary_string@fax.uic.edu for faxes.
  23. This format lets us send faxes to BobJ66834@fax.uic.edu and
  24. JohnA66834@fax.uic.edu. The reasoning behind this is historical at UIC. In
  25. any case, the following instructions will allow you to send e-mail to
  26. somenumber@fax.yournode.yourdomain and have FlexFax (or any other fax package,
  27. I assume) queue the file for transmission. For below, replace "fax.uic.edu"
  28. with whatever you want your fax desination to be called, like "fax.blah.edu".
  29.  
  30.  
  31. 1. Edit the /etc/sendmail.cf file. There are two lines you must add. First,
  32. define a fax mailer, called fax, with the line
  33.  
  34. Mfax, P=/usr/local/bin/faxmailer, F=SmsDFMuL, S=16, R=26, E=\r\n,
  35.     A=faxmailer $h $u
  36.  
  37. This is also documented in Dirk's documentation. The S flag means to run the
  38. mailer program as the root user. This is needed for one reason. If mail comes
  39. in via SMTP, the faxmailer script is run as user daemon. If the mail originates
  40. on the same machine that your MX points to, then the script is run as the
  41. user submitting the fax via mail. If this happens, I get a Perl "Insecure
  42. Dependancy Error" which I don't try to understand, but never the less, it
  43. doesn't work. If you won't have users on the same machine
  44. submitting faxes, then you can do without the S flag, and the processes will
  45. be run as daemon. The E=\r\n must be there so that the perl script knows when
  46. the end of header has been reached.
  47.  
  48. One change from Dirk's code here is that faxmailer.c (for me anyway) did not
  49. work as supplied. I had to change the setruid() call to setuid(). The way
  50. it's distributed, I get a mailer configuration error.
  51.  
  52. Second, add this entry to rule set 0. It's best to be the first rule in
  53. S0, since it'll be evaluated first, without any name changes.
  54.  
  55. R$+ < @ fax.uic.edu. >    $#fax$@fax$:$1
  56.  
  57. sendmail 8.6.9 requires the trailing dot. Other sendmails may vary. This
  58. command tells sendmail that when it sees mail destined for fax.uic.edu to
  59. route the mail to the 'fax' mailer defined above.
  60.  
  61. Note: If you're using the .mc config files in Berkeley sendmail, you can use
  62.  
  63. LOCAL_RULE_0
  64. R$+ < @ fax.uic.edu. >    $#fax$@fax$:$1
  65.  
  66. 2. Have your namserver person add an MX entry for your fax domain.  NOTE:
  67. This entry MUST be an MX record; it can NOT be a CNAME. It just won't work.
  68.  
  69. 3. Copy parser.pl to /usr/local/lib/perl . perser.pl is a Perl library to
  70. handle RFC822 header parsing, so that you don't need to tell people to use
  71. 66834/TO=Bob_Jackiewicz@fax.uic.edu. With mine, you can use the standard
  72. "Bob Jackiewicz" <66834@fax.uic.edu> and it'll parse out the name and phone
  73. number. If the name doesn't exist, it'll use the phone number as the To:
  74. on the cover sheet. So, if you can't make a To: field like above, you can
  75. use  <bob_jackiewicz66834@fax.uic.edu> and that will make a nicer To: field
  76. than just a phone number.
  77.  
  78. Explaination here. Dirk suggests that you make faxmailer set-uid to uucp. I
  79. couldn't get this to work, so my faxmailer program is not setuid, but is
  80. run as root because of the S flag in the mailer definition. Therefore,
  81. the two ids need to be members of those groups in order to be able to send
  82. back the ORIGINAL text found in the orig directory. If you don't want this
  83. feature, you don't have to do steps 4, 5, and 6.
  84.  
  85. 4. Create directory /var/spool/fax/orig with permissions 770, owner uucp.staff.
  86. I made this directory so that the original text can be sent back to the
  87. client when the fax dies, for some reason. Telling people to "uudecode, untar,
  88. and resubmit with sendfax..." doesn't go over well for e-mail gateway users
  89. on various types of architectures, with various degrees of expertise.
  90.  
  91. 5. Replace /var/spool/fax/bin/notify.awk with the one which comes with this
  92. package. This notify.awk will erase the files in the orig directory when done.
  93.  
  94. 6. Make uucp and daemon members of group staff.  This group stuff may
  95. need to be modified to your system's preference. You may want to create a 
  96. new group, called efax which can handle all the permissions for the orig
  97. files. It's up to you. But if things don't work, check your group set.
  98.  
  99. That's basically it!
  100.  
  101. I also added the ability to send PostScript files through mail and have
  102. them be recognized as such, and sent out. The mail file must start with
  103. %! as the first non-blank line after the header in order for it to be
  104. recognized as a PS file. Also, some mailers might chop records at 80 columns, 
  105. so you should tell your users that they should (if possible) create PS files
  106. with lines <= 80 characters. I also do a check of the top of the body for
  107. any lines which might begin with PostScript-like code.
  108.  
  109. I also added phone number canonicalization in faxmailer-agent as the
  110. one built in to FlexFax seems a bit flakey (read: I didn't bother
  111. trying to figure it out :-) ). You can keep it or dispose of it as you see
  112. fit. I assume it's also easier to add restrictions for 900 and 976 numbers
  113. in the US (in the US, those numbers cost lots of money just for connecting).
  114.  
  115.  
  116.  
  117.    I am running this on an RS/6000, with AIX 3.2.5, and sendmail 8.6.9, and
  118. it works.
  119.  
  120. I put this down from my head, so it may not be complete. There's some
  121. debugging left in, which you can take out. It's simple prints as well as
  122. some mail which is sent to my account. Change the $human variable. 
  123. If you have any questions, feel free to send me mail. I'll try to help you as
  124. best I can. I can be reached at bobj@uic.edu.
  125.  
  126.         Good luck!
  127.             Bob Jackiewicz
  128.